import {
	httpConfig
} from "./env";

import {
	requestInterceptors,
	responseInterceptors
} from './interceptors.js'

// 引入luch-request
import {
	http
} from 'uview-plus'
//  初始化请求配置
const initRequest = (vm) => {
	http.setConfig((defaultConfig) => {
		defaultConfig.baseURL = httpConfig.baseURL /* 根域名 */
		defaultConfig.header = {
			...defaultConfig.header,
			'Content-Type': 'application/json;charset=UTF-8',
		}
		return defaultConfig
	})
	requestInterceptors()
	responseInterceptors()
}
export {
	initRequest
}